Integrand size = 31, antiderivative size = 158 \[ \int (g+h x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=-\frac {B (b c-a d) h (3 b d g-b c h-a d h) n x}{3 b^2 d^2}-\frac {B (b c-a d) h^2 n x^2}{6 b d}-\frac {B (b g-a h)^3 n \log (a+b x)}{3 b^3 h}+\frac {B (d g-c h)^3 n \log (c+d x)}{3 d^3 h}+\frac {(g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{3 h} \]
-1/3*B*(-a*d+b*c)*h*(-a*d*h-b*c*h+3*b*d*g)*n*x/b^2/d^2-1/6*B*(-a*d+b*c)*h^ 2*n*x^2/b/d-1/3*B*(-a*h+b*g)^3*n*ln(b*x+a)/b^3/h+1/3*B*(-c*h+d*g)^3*n*ln(d *x+c)/d^3/h+1/3*(h*x+g)^3*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))/h
Time = 0.24 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.29 \[ \int (g+h x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {2 a^2 B d^3 h (-3 b g+a h) n \log (a+b x)+b \left (d x \left (B (b c-a d) h n (-6 b d g+2 b c h+2 a d h-b d h x)+2 A b^2 d^2 \left (3 g^2+3 g h x+h^2 x^2\right )\right )-2 b B \left (-3 a d^3 g^2+b c \left (3 d^2 g^2-3 c d g h+c^2 h^2\right )\right ) n \log (c+d x)+2 b B d^3 \left (3 a g^2+b x \left (3 g^2+3 g h x+h^2 x^2\right )\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{6 b^3 d^3} \]
(2*a^2*B*d^3*h*(-3*b*g + a*h)*n*Log[a + b*x] + b*(d*x*(B*(b*c - a*d)*h*n*( -6*b*d*g + 2*b*c*h + 2*a*d*h - b*d*h*x) + 2*A*b^2*d^2*(3*g^2 + 3*g*h*x + h ^2*x^2)) - 2*b*B*(-3*a*d^3*g^2 + b*c*(3*d^2*g^2 - 3*c*d*g*h + c^2*h^2))*n* Log[c + d*x] + 2*b*B*d^3*(3*a*g^2 + b*x*(3*g^2 + 3*g*h*x + h^2*x^2))*Log[( e*(a + b*x)^n)/(c + d*x)^n]))/(6*b^3*d^3)
Time = 0.34 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.01, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {2948, 93, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (g+h x)^2 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right ) \, dx\) |
\(\Big \downarrow \) 2948 |
\(\displaystyle \frac {(g+h x)^3 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{3 h}-\frac {B n (b c-a d) \int \frac {(g+h x)^3}{(a+b x) (c+d x)}dx}{3 h}\) |
\(\Big \downarrow \) 93 |
\(\displaystyle \frac {(g+h x)^3 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{3 h}-\frac {B n (b c-a d) \int \left (\frac {x h^3}{b d}+\frac {(3 b d g-b c h-a d h) h^2}{b^2 d^2}+\frac {(b g-a h)^3}{b^2 (b c-a d) (a+b x)}+\frac {(d g-c h)^3}{d^2 (a d-b c) (c+d x)}\right )dx}{3 h}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {(g+h x)^3 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{3 h}-\frac {B n (b c-a d) \left (\frac {(b g-a h)^3 \log (a+b x)}{b^3 (b c-a d)}+\frac {h^2 x (-a d h-b c h+3 b d g)}{b^2 d^2}-\frac {(d g-c h)^3 \log (c+d x)}{d^3 (b c-a d)}+\frac {h^3 x^2}{2 b d}\right )}{3 h}\) |
-1/3*(B*(b*c - a*d)*n*((h^2*(3*b*d*g - b*c*h - a*d*h)*x)/(b^2*d^2) + (h^3* x^2)/(2*b*d) + ((b*g - a*h)^3*Log[a + b*x])/(b^3*(b*c - a*d)) - ((d*g - c* h)^3*Log[c + d*x])/(d^3*(b*c - a*d))))/h + ((g + h*x)^3*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n]))/(3*h)
3.3.95.3.1 Defintions of rubi rules used
Int[((e_.) + (f_.)*(x_))^(p_)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_] :> Int[ExpandIntegrand[(e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; Fre eQ[{a, b, c, d, e, f}, x] && IntegerQ[p]
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ )]*(B_.))*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(f + g*x)^(m + 1)*( (A + B*Log[e*((a + b*x)^n/(c + d*x)^n)])/(g*(m + 1))), x] - Simp[B*n*((b*c - a*d)/(g*(m + 1))) Int[(f + g*x)^(m + 1)/((a + b*x)*(c + d*x)), x], x] / ; FreeQ[{a, b, c, d, e, f, g, A, B, m, n}, x] && EqQ[n + mn, 0] && NeQ[b*c - a*d, 0] && NeQ[m, -1] && !(EqQ[m, -2] && IntegerQ[n])
Leaf count of result is larger than twice the leaf count of optimal. \(622\) vs. \(2(148)=296\).
Time = 11.35 (sec) , antiderivative size = 623, normalized size of antiderivative = 3.94
method | result | size |
parallelrisch | \(\frac {-2 B \,b^{3} c^{3} h^{2} n^{2}+2 B \,a^{3} d^{3} h^{2} n^{2}+6 B x a \,b^{2} d^{3} g h \,n^{2}-6 B x \,b^{3} c \,d^{2} g h \,n^{2}-6 B \ln \left (b x +a \right ) a^{2} b \,d^{3} g h \,n^{2}+6 B \,x^{2} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{3} d^{3} g h n +6 B \ln \left (b x +a \right ) b^{3} c^{2} d g h \,n^{2}-6 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{3} c^{2} d g h n +2 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{3} c^{3} h^{2} n -6 A a \,b^{2} c \,d^{2} g h n +B \,a^{2} b c \,d^{2} h^{2} n^{2}-6 B \,a^{2} b \,d^{3} g h \,n^{2}-B a \,b^{2} c^{2} d \,h^{2} n^{2}+6 B \,b^{3} c^{2} d g h \,n^{2}+B \,x^{2} a \,b^{2} d^{3} h^{2} n^{2}-B \,x^{2} b^{3} c \,d^{2} h^{2} n^{2}+6 A \,x^{2} b^{3} d^{3} g h n -2 B x \,a^{2} b \,d^{3} h^{2} n^{2}+2 B x \,b^{3} c^{2} d \,h^{2} n^{2}+6 B \ln \left (b x +a \right ) a \,b^{2} d^{3} g^{2} n^{2}-6 B \ln \left (b x +a \right ) b^{3} c \,d^{2} g^{2} n^{2}-6 A a \,b^{2} d^{3} g^{2} n -6 A \,b^{3} c \,d^{2} g^{2} n +2 A \,x^{3} b^{3} d^{3} h^{2} n +6 A x \,b^{3} d^{3} g^{2} n +2 B \ln \left (b x +a \right ) a^{3} d^{3} h^{2} n^{2}-2 B \ln \left (b x +a \right ) b^{3} c^{3} h^{2} n^{2}+6 B \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{3} c \,d^{2} g^{2} n +2 B \,x^{3} \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{3} d^{3} h^{2} n +6 B x \ln \left (e \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\right ) b^{3} d^{3} g^{2} n}{6 b^{3} d^{3} n}\) | \(623\) |
risch | \(\text {Expression too large to display}\) | \(1425\) |
1/6*(-2*B*b^3*c^3*h^2*n^2+2*B*a^3*d^3*h^2*n^2-6*B*ln(e*(b*x+a)^n/((d*x+c)^ n))*b^3*c^2*d*g*h*n+6*B*x^2*ln(e*(b*x+a)^n/((d*x+c)^n))*b^3*d^3*g*h*n+6*B* x*a*b^2*d^3*g*h*n^2-6*B*x*b^3*c*d^2*g*h*n^2-6*B*ln(b*x+a)*a^2*b*d^3*g*h*n^ 2+6*B*ln(b*x+a)*b^3*c^2*d*g*h*n^2-6*A*a*b^2*c*d^2*g*h*n+B*a^2*b*c*d^2*h^2* n^2-6*B*a^2*b*d^3*g*h*n^2-B*a*b^2*c^2*d*h^2*n^2+6*B*b^3*c^2*d*g*h*n^2+6*B* ln(e*(b*x+a)^n/((d*x+c)^n))*b^3*c*d^2*g^2*n+2*B*x^3*ln(e*(b*x+a)^n/((d*x+c )^n))*b^3*d^3*h^2*n+B*x^2*a*b^2*d^3*h^2*n^2-B*x^2*b^3*c*d^2*h^2*n^2+6*A*x^ 2*b^3*d^3*g*h*n+6*B*x*ln(e*(b*x+a)^n/((d*x+c)^n))*b^3*d^3*g^2*n-2*B*x*a^2* b*d^3*h^2*n^2+2*B*x*b^3*c^2*d*h^2*n^2+6*B*ln(b*x+a)*a*b^2*d^3*g^2*n^2-6*B* ln(b*x+a)*b^3*c*d^2*g^2*n^2-6*A*a*b^2*d^3*g^2*n-6*A*b^3*c*d^2*g^2*n+2*B*ln (e*(b*x+a)^n/((d*x+c)^n))*b^3*c^3*h^2*n+2*A*x^3*b^3*d^3*h^2*n+6*A*x*b^3*d^ 3*g^2*n+2*B*ln(b*x+a)*a^3*d^3*h^2*n^2-2*B*ln(b*x+a)*b^3*c^3*h^2*n^2)/b^3/d ^3/n
Leaf count of result is larger than twice the leaf count of optimal. 365 vs. \(2 (148) = 296\).
Time = 0.32 (sec) , antiderivative size = 365, normalized size of antiderivative = 2.31 \[ \int (g+h x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {2 \, A b^{3} d^{3} h^{2} x^{3} + {\left (6 \, A b^{3} d^{3} g h - {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} h^{2} n\right )} x^{2} + 2 \, {\left (3 \, A b^{3} d^{3} g^{2} - {\left (3 \, {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} g h - {\left (B b^{3} c^{2} d - B a^{2} b d^{3}\right )} h^{2}\right )} n\right )} x + 2 \, {\left (B b^{3} d^{3} h^{2} n x^{3} + 3 \, B b^{3} d^{3} g h n x^{2} + 3 \, B b^{3} d^{3} g^{2} n x + {\left (3 \, B a b^{2} d^{3} g^{2} - 3 \, B a^{2} b d^{3} g h + B a^{3} d^{3} h^{2}\right )} n\right )} \log \left (b x + a\right ) - 2 \, {\left (B b^{3} d^{3} h^{2} n x^{3} + 3 \, B b^{3} d^{3} g h n x^{2} + 3 \, B b^{3} d^{3} g^{2} n x + {\left (3 \, B b^{3} c d^{2} g^{2} - 3 \, B b^{3} c^{2} d g h + B b^{3} c^{3} h^{2}\right )} n\right )} \log \left (d x + c\right ) + 2 \, {\left (B b^{3} d^{3} h^{2} x^{3} + 3 \, B b^{3} d^{3} g h x^{2} + 3 \, B b^{3} d^{3} g^{2} x\right )} \log \left (e\right )}{6 \, b^{3} d^{3}} \]
1/6*(2*A*b^3*d^3*h^2*x^3 + (6*A*b^3*d^3*g*h - (B*b^3*c*d^2 - B*a*b^2*d^3)* h^2*n)*x^2 + 2*(3*A*b^3*d^3*g^2 - (3*(B*b^3*c*d^2 - B*a*b^2*d^3)*g*h - (B* b^3*c^2*d - B*a^2*b*d^3)*h^2)*n)*x + 2*(B*b^3*d^3*h^2*n*x^3 + 3*B*b^3*d^3* g*h*n*x^2 + 3*B*b^3*d^3*g^2*n*x + (3*B*a*b^2*d^3*g^2 - 3*B*a^2*b*d^3*g*h + B*a^3*d^3*h^2)*n)*log(b*x + a) - 2*(B*b^3*d^3*h^2*n*x^3 + 3*B*b^3*d^3*g*h *n*x^2 + 3*B*b^3*d^3*g^2*n*x + (3*B*b^3*c*d^2*g^2 - 3*B*b^3*c^2*d*g*h + B* b^3*c^3*h^2)*n)*log(d*x + c) + 2*(B*b^3*d^3*h^2*x^3 + 3*B*b^3*d^3*g*h*x^2 + 3*B*b^3*d^3*g^2*x)*log(e))/(b^3*d^3)
Exception generated. \[ \int (g+h x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\text {Exception raised: HeuristicGCDFailed} \]
Time = 0.20 (sec) , antiderivative size = 294, normalized size of antiderivative = 1.86 \[ \int (g+h x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {1}{3} \, B h^{2} x^{3} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac {1}{3} \, A h^{2} x^{3} + B g h x^{2} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g h x^{2} + B g^{2} x \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g^{2} x + \frac {{\left (\frac {a e n \log \left (b x + a\right )}{b} - \frac {c e n \log \left (d x + c\right )}{d}\right )} B g^{2}}{e} - \frac {{\left (\frac {a^{2} e n \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} e n \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c e n - a d e n\right )} x}{b d}\right )} B g h}{e} + \frac {{\left (\frac {2 \, a^{3} e n \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} e n \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d e n - a b d^{2} e n\right )} x^{2} - 2 \, {\left (b^{2} c^{2} e n - a^{2} d^{2} e n\right )} x}{b^{2} d^{2}}\right )} B h^{2}}{6 \, e} \]
1/3*B*h^2*x^3*log((b*x + a)^n*e/(d*x + c)^n) + 1/3*A*h^2*x^3 + B*g*h*x^2*l og((b*x + a)^n*e/(d*x + c)^n) + A*g*h*x^2 + B*g^2*x*log((b*x + a)^n*e/(d*x + c)^n) + A*g^2*x + (a*e*n*log(b*x + a)/b - c*e*n*log(d*x + c)/d)*B*g^2/e - (a^2*e*n*log(b*x + a)/b^2 - c^2*e*n*log(d*x + c)/d^2 + (b*c*e*n - a*d*e *n)*x/(b*d))*B*g*h/e + 1/6*(2*a^3*e*n*log(b*x + a)/b^3 - 2*c^3*e*n*log(d*x + c)/d^3 - ((b^2*c*d*e*n - a*b*d^2*e*n)*x^2 - 2*(b^2*c^2*e*n - a^2*d^2*e* n)*x)/(b^2*d^2))*B*h^2/e
Leaf count of result is larger than twice the leaf count of optimal. 304 vs. \(2 (148) = 296\).
Time = 46.92 (sec) , antiderivative size = 304, normalized size of antiderivative = 1.92 \[ \int (g+h x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=\frac {1}{3} \, {\left (B h^{2} \log \left (e\right ) + A h^{2}\right )} x^{3} + \frac {1}{3} \, {\left (B h^{2} n x^{3} + 3 \, B g h n x^{2} + 3 \, B g^{2} n x\right )} \log \left (b x + a\right ) - \frac {1}{3} \, {\left (B h^{2} n x^{3} + 3 \, B g h n x^{2} + 3 \, B g^{2} n x\right )} \log \left (d x + c\right ) - \frac {{\left (B b c h^{2} n - B a d h^{2} n - 6 \, B b d g h \log \left (e\right ) - 6 \, A b d g h\right )} x^{2}}{6 \, b d} + \frac {{\left (3 \, B a b^{2} g^{2} n - 3 \, B a^{2} b g h n + B a^{3} h^{2} n\right )} \log \left (b x + a\right )}{3 \, b^{3}} - \frac {{\left (3 \, B c d^{2} g^{2} n - 3 \, B c^{2} d g h n + B c^{3} h^{2} n\right )} \log \left (-d x - c\right )}{3 \, d^{3}} - \frac {{\left (3 \, B b^{2} c d g h n - 3 \, B a b d^{2} g h n - B b^{2} c^{2} h^{2} n + B a^{2} d^{2} h^{2} n - 3 \, B b^{2} d^{2} g^{2} \log \left (e\right ) - 3 \, A b^{2} d^{2} g^{2}\right )} x}{3 \, b^{2} d^{2}} \]
1/3*(B*h^2*log(e) + A*h^2)*x^3 + 1/3*(B*h^2*n*x^3 + 3*B*g*h*n*x^2 + 3*B*g^ 2*n*x)*log(b*x + a) - 1/3*(B*h^2*n*x^3 + 3*B*g*h*n*x^2 + 3*B*g^2*n*x)*log( d*x + c) - 1/6*(B*b*c*h^2*n - B*a*d*h^2*n - 6*B*b*d*g*h*log(e) - 6*A*b*d*g *h)*x^2/(b*d) + 1/3*(3*B*a*b^2*g^2*n - 3*B*a^2*b*g*h*n + B*a^3*h^2*n)*log( b*x + a)/b^3 - 1/3*(3*B*c*d^2*g^2*n - 3*B*c^2*d*g*h*n + B*c^3*h^2*n)*log(- d*x - c)/d^3 - 1/3*(3*B*b^2*c*d*g*h*n - 3*B*a*b*d^2*g*h*n - B*b^2*c^2*h^2* n + B*a^2*d^2*h^2*n - 3*B*b^2*d^2*g^2*log(e) - 3*A*b^2*d^2*g^2)*x/(b^2*d^2 )
Time = 1.19 (sec) , antiderivative size = 372, normalized size of antiderivative = 2.35 \[ \int (g+h x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx=x^2\,\left (\frac {3\,A\,a\,d\,h^2+3\,A\,b\,c\,h^2+6\,A\,b\,d\,g\,h+B\,a\,d\,h^2\,n-B\,b\,c\,h^2\,n}{6\,b\,d}-\frac {A\,h^2\,\left (3\,a\,d+3\,b\,c\right )}{6\,b\,d}\right )+\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\,\left (B\,g^2\,x+B\,g\,h\,x^2+\frac {B\,h^2\,x^3}{3}\right )-x\,\left (\frac {\left (3\,a\,d+3\,b\,c\right )\,\left (\frac {3\,A\,a\,d\,h^2+3\,A\,b\,c\,h^2+6\,A\,b\,d\,g\,h+B\,a\,d\,h^2\,n-B\,b\,c\,h^2\,n}{3\,b\,d}-\frac {A\,h^2\,\left (3\,a\,d+3\,b\,c\right )}{3\,b\,d}\right )}{3\,b\,d}-\frac {3\,A\,a\,c\,h^2+3\,A\,b\,d\,g^2+6\,A\,a\,d\,g\,h+6\,A\,b\,c\,g\,h+3\,B\,a\,d\,g\,h\,n-3\,B\,b\,c\,g\,h\,n}{3\,b\,d}+\frac {A\,a\,c\,h^2}{b\,d}\right )+\frac {A\,h^2\,x^3}{3}+\frac {\ln \left (a+b\,x\right )\,\left (B\,n\,a^3\,h^2-3\,B\,n\,a^2\,b\,g\,h+3\,B\,n\,a\,b^2\,g^2\right )}{3\,b^3}-\frac {\ln \left (c+d\,x\right )\,\left (B\,n\,c^3\,h^2-3\,B\,n\,c^2\,d\,g\,h+3\,B\,n\,c\,d^2\,g^2\right )}{3\,d^3} \]
x^2*((3*A*a*d*h^2 + 3*A*b*c*h^2 + 6*A*b*d*g*h + B*a*d*h^2*n - B*b*c*h^2*n) /(6*b*d) - (A*h^2*(3*a*d + 3*b*c))/(6*b*d)) + log((e*(a + b*x)^n)/(c + d*x )^n)*((B*h^2*x^3)/3 + B*g^2*x + B*g*h*x^2) - x*(((3*a*d + 3*b*c)*((3*A*a*d *h^2 + 3*A*b*c*h^2 + 6*A*b*d*g*h + B*a*d*h^2*n - B*b*c*h^2*n)/(3*b*d) - (A *h^2*(3*a*d + 3*b*c))/(3*b*d)))/(3*b*d) - (3*A*a*c*h^2 + 3*A*b*d*g^2 + 6*A *a*d*g*h + 6*A*b*c*g*h + 3*B*a*d*g*h*n - 3*B*b*c*g*h*n)/(3*b*d) + (A*a*c*h ^2)/(b*d)) + (A*h^2*x^3)/3 + (log(a + b*x)*(B*a^3*h^2*n + 3*B*a*b^2*g^2*n - 3*B*a^2*b*g*h*n))/(3*b^3) - (log(c + d*x)*(B*c^3*h^2*n + 3*B*c*d^2*g^2*n - 3*B*c^2*d*g*h*n))/(3*d^3)